package com.preguicoso.server.dao;

import java.util.List;

import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.util.DAOBase;
import com.preguicoso.shared.entities.BannerBean;

public class BannerDAO extends DAOBase {
	static {
		ObjectifyService.register(BannerBean.class);
	}

	public void create(BannerBean u) {
		this.ofy().put(u);
	}

	public BannerBean retrieve(Long e) {
		return this.ofy().query(BannerBean.class).filter("estabelecimentoId", e).get();
	}

	public void update(BannerBean u) {
		this.ofy().put(u);
	}

	public void delete(BannerBean u) {
		this.ofy().delete(u);
	}

	public List<BannerBean> listAll() {
		return this.ofy().query(BannerBean.class).list();
	}

}